<template>
  <div class="store" @click="$router.push({ path: '/pages/storeInfo/storeInfo', query: { cate_id: data.id||data.store_id } }) ">
    <div class="store-pic">
      <img :src="data.store_logo" alt="">
    </div>
    <div class="store-info">
      <div class="store-name">
        <div class="store-title">
          <p>{{data.name||data.store_name}}</p>
          <img src="../../static/images/icon-renzheng.png" alt="">
          <img src="../../static/images/icon-zhizhao.png" alt="">
        </div>
      </div>
      <div class="store-rate">
        <i-rate count="5" size="16" :value="data.store_credit">{{data.store_credit}}.0</i-rate>
        <p v-if="data.store_sales">销量{{data.store_sales}}</p>
      </div>
      <div class="store-tags" v-if="data.store_label">
        <div class="store-tag" v-for="(item,index) in tagList" :key="index">{{item}}</div>
      </div>
      <div class="store-location" v-if="data.address">
        <div>{{data.address}}</div>
        <div>距离{{distance}}km</div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    mapState
  } from "Vuex";
  // 依赖
  export default {
    props: ["data"],
    data() {
      return {
        tagList: [],
        distance: (this.data.distance / 1000).toFixed(2)
      }
    },
    created() {
      if (this.data.store_label) {
        this.tagList = this.data.store_label.split(',')
      }
    },
    methods: {

    },
    mounted() {
    }
  };

</script>

<style lang="less">


</style>
